package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CarEvaluationMapper;
import com.ruoyi.system.domain.CarEvaluation;
import com.ruoyi.system.service.ICarEvaluationService;

/**
 * 评价Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-14
 */
@Service
public class CarEvaluationServiceImpl implements ICarEvaluationService 
{
    @Autowired
    private CarEvaluationMapper carEvaluationMapper;

    /**
     * 查询评价
     * 
     * @param evaluationId 评价主键
     * @return 评价
     */
    @Override
    public CarEvaluation selectCarEvaluationByEvaluationId(Integer evaluationId)
    {
        return carEvaluationMapper.selectCarEvaluationByEvaluationId(evaluationId);
    }

    /**
     * 查询评价列表
     * 
     * @param carEvaluation 评价
     * @return 评价
     */
    @Override
    public List<CarEvaluation> selectCarEvaluationList(CarEvaluation carEvaluation)
    {
        return carEvaluationMapper.selectCarEvaluationList(carEvaluation);
    }

    /**
     * 新增评价
     * 
     * @param carEvaluation 评价
     * @return 结果
     */
    @Override
    public int insertCarEvaluation(CarEvaluation carEvaluation)
    {
        return carEvaluationMapper.insertCarEvaluation(carEvaluation);
    }

    /**
     * 修改评价
     * 
     * @param carEvaluation 评价
     * @return 结果
     */
    @Override
    public int updateCarEvaluation(CarEvaluation carEvaluation)
    {
        carEvaluation.setUpdateTime(DateUtils.getNowDate());
        return carEvaluationMapper.updateCarEvaluation(carEvaluation);
    }

    /**
     * 批量删除评价
     * 
     * @param evaluationIds 需要删除的评价主键
     * @return 结果
     */
    @Override
    public int deleteCarEvaluationByEvaluationIds(Integer[] evaluationIds)
    {
        return carEvaluationMapper.deleteCarEvaluationByEvaluationIds(evaluationIds);
    }

    /**
     * 删除评价信息
     * 
     * @param evaluationId 评价主键
     * @return 结果
     */
    @Override
    public int deleteCarEvaluationByEvaluationId(Integer evaluationId)
    {
        return carEvaluationMapper.deleteCarEvaluationByEvaluationId(evaluationId);
    }

    @Override
    public List<CarEvaluation> getEvaluateByMerchantId(Integer mId)
    {
        return carEvaluationMapper.getEvaluateByMerchantId(mId);
    }
}
